﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using CorporateGym.DAL;

namespace BLL
{
    public class Message
    {
        public int MessageId { get; set; }
        public int ParentMessageId { get; set; }
        public int SenderId{ get; set; }
        public DateTime CreateTime{ get; set; }
        public string Subject{ get; set; }
        public string Text { get; set; }
        public bool IsMessageBoard { get; set; }

        public static Message CreateFromRow(CorporateGymDB.MessageRow i_Row)
        {
            return new Message
            {
                MessageId = i_Row.MessageId,
                ParentMessageId = i_Row.ParentMessageId,
                SenderId = i_Row.SenderId,
                CreateTime = i_Row.CreateTime,
                Subject = i_Row.Subject,
                Text = i_Row.Text,
                IsMessageBoard = i_Row.IsMessageBoard
            };
        }
    
    } 
}
